package com.example.hjlquickstartdemo.pojo.dto;

import com.example.hjlquickstartdemo.base.BaseDto;
import com.example.hjlquickstartdemo.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import java.util.Date;

/**
 * user数据传输对象
 *
 * @author HeJiaLe
 * @date 2023/07/17 13:57
 **/
@ApiModel(value = "UserDto",description="增加和修改功能使用的用户对象")
@Data
@Slf4j
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode
public class UserDto extends BaseDto {
    /**
     *  id 雪花算法生成对应行的记录id
     */
    @ApiModelProperty("记录id")
    @JsonSerialize(using= ToStringSerializer.class)
    private Long id;
    /**
     *  姓名
     */
    @ApiModelProperty(value = "姓名",required = true)
    @NotBlank(message = "姓名不能为空")
    private String name;
    /**
     *  身份证id
     */
    @ApiModelProperty(value = "身份证id",required = true)
    @NotBlank(message = "身份证id不能为空")
    private String citizenId;
    /**
     *  生日
     */
    @ApiModelProperty("生日")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8", pattern ="yyyy-MM-dd")
    private Date birthday;


}
